package com.sitia.jd.controller;

import com.sitia.common.core.controller.BaseController;
import com.sitia.common.core.domain.AjaxResult;
import com.sitia.common.core.page.TableDataInfo;
import com.sitia.jd.domain.MxOrder;
import com.sitia.jd.domain.MxOrderHis;
import com.sitia.jd.service.IMxOrderHisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * mx订单历史Controller
 *
 * @author sitia
 * @date 2023-05-22
 */
@RestController
@RequestMapping("/jd/order/his")
public class MxOrderHisController extends BaseController {
    @Autowired
    private IMxOrderHisService mxOrderHisService;
    /**
     * 查询mx订单列表
     */
    @GetMapping("/list")
    public TableDataInfo list(MxOrderHis mxOrder)
    {
        startPage();
        List<MxOrderHis> list = mxOrderHisService.selectMxOrderHisPageList(mxOrder);
        return getDataTable(list);
    }

    /**
     * 归历史操作
     * @param archiverTime 归档范围
     * @return
     */
    @PostMapping("/archive")
    public AjaxResult archive(@RequestBody List<Date> archiverTime)
    {
        return toAjax(mxOrderHisService.archive(archiverTime));
    }

}
